# _*_ encoding:utf-8 _*_

from rest_framework import serializers

from goods.models import GoodsChannel, GoodsChannelGroup


class ChannelGroupSerializer(serializers.ModelSerializer):

    class Meta:
        model = GoodsChannelGroup
        fields = ['id', 'name']


class ChannelModelSerializer(serializers.ModelSerializer):
    group = serializers.StringRelatedField()
    group_id = serializers.IntegerField()
    category = serializers.StringRelatedField()
    category_id = serializers.IntegerField()

    class Meta:
        model = GoodsChannel
        fields = '__all__'




